home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 April / CICA MS Windows - April 1993.iso / unzipped / programr / vbasic / 256vbcol / 256picbx.frm (.txt) < prev    next >
Visual Basic Form  |  1992-03-16  |  9KB  |  208 lines

  1. frm256PicBx
  2. &256 Color VB Picture Box Demonstration
  3. Form1,
  4. Label1
  5. Current Directory:
  6. labDirSelected
  7. pbCancel
  8. E&XIT
  9. Label2
  10. &Directories
  11. Label3
  12. &Bitmap Files
  13. R    lbDirList
  14. lbFileList
  15. *.bmp
  16. PicPreview
  17. PicPreviewVScroll
  18. Label4
  19. D&rives
  20. cbDrives
  21. W    pbPreview
  22. &Preview
  23. PicPreviewHScroll    
  24. PicScrollBarFiller
  25. PicPreviewSource
  26. hDIBUtilH
  27. hPalette
  28. hDIBBuffer
  29. lpDIBBuffer\
  30. @    Form_Load
  31. OldMousePtr
  32. Screen
  33. MousePointer
  34.     HOURGLASS
  35. Set_ModalDlg_SysMenu
  36. frmDirSelectn
  37. StartingDir
  38. labDirSelected
  39. Captionu
  40. cbDrives
  41. Drive
  42.     lbDirList
  43. SBColors
  44. GetProfileInfoa
  45. PicScrollbarFiller
  46.     BackColor
  47. LoadLibrary
  48. NULL/
  49. lbDirList_Change
  50. lbFileList
  51. pbCancel_ClickR
  52. cbDrives_Change
  53. lbFileList_DblClickU
  54. pbPreview_Click
  55. lbFileList_PathChange
  56.     ListIndexe
  57. SrcXn
  58. DestX7
  59. DestY
  60. bmpWidth
  61.     bmpHeight
  62. ShowFiller
  63. PicPreview
  64. Picturep
  65. PicPreviewSourceL
  66. FName
  67. ListE
  68. DIBLoad
  69. FastExit'
  70. GlobalLock
  71. DIBWidth
  72.     DIBHeight
  73.     ReturnVal
  74. GlobalUnlock
  75. ScaleWidth
  76.     DestWidth
  77. ScaleHeighto
  78. DestHeight
  79. PicPreviewHScrollG
  80. Visible
  81. FALSE
  82. SmallChange
  83. LargeChange5
  84. Value
  85. PicPreviewVScrolld
  86. DeleteObjectB
  87. CreateDIBPalette
  88. hOldPalette
  89. SelectPalette
  90. RealizePalette
  91. hBitmap
  92. CreateDIBitmap
  93. CBM_INIT
  94. FindDIBBits
  95. DIB_RGB_INFO
  96.     hCompatDC
  97. CreateCompatibleDC
  98. hPrevBmp
  99. SelectObject
  100. Success
  101. BitBltt
  102. SRCCOPY
  103. DeleteDC[
  104. GlobalFree
  105. APIError0
  106. PicPreviewHScroll_Change
  107. PicPreviewVScroll_Changee
  108. Form_Unload
  109. Cancel
  110. FreeLibrary,
  111. Section
  112. KeyName
  113. Result
  114. ResultLength
  115. GetProfileString
  116. A_Form
  117. HSysMenu
  118. GetSystemMenu
  119. RemoveMenu
  120. MF_BYPOSITION
  121. pbOK_Click9
  122. PicBx
  123. frm256PicBx
  124.     hScreenDC
  125. GetDC
  126.     ReleaseDC
  127. hMyDC`
  128.  Handle to our dll
  129.  Handle to a palette created for previewing a bitmap
  130.  Handle to a global memory area into which a DIB file has been read
  131.  (for use with DIB utility routines)
  132.  A pointer to the actual memory buffer containing the DIB 
  133. Form_Load
  134. Remove all but Move and Close from the system menu
  135. Set up starting directoryl
  136. Colors
  137. ScrollBar"
  138.  Load the DIBUTIL library"
  139.     hDIBUtil = LoadLibrary("DIBUTIL.DLL")
  140.  Since we haven't yet created a palette, initialize hPalette tor
  141.  null to indicate this
  142. lbDirList_Change
  143. pbCancel_Click
  144. cbDrives_Change
  145. lbFileList_DblClick
  146. lbFileList_PathChange
  147. pbPreview_Click
  148. Set an hourglass cursor
  149. Clear any existing bitmaps
  150. If no bitmap file is selected, take the first onez
  151. Load the bitmap into memory and get its dimensions
  152. Error loading 
  153. Set up bitblt parameters
  154. Set up the scroll bars
  155. If we have previously created a palette, delete it now
  156. (pbPreview_Click) Warning: Could not delete hPalette!"
  157. Create a new palette for this bitmap
  158.  Make sure DC containing the persistent image has the right palette
  159.  Make sure the picture box DC has the right paletteh
  160. Lock the memory block
  161.  Create a Device Dependent Bitmap 
  162.  Create a memory DC from which we can bitblt the image.  Select in and
  163.  realize the palette, then select in the ddb
  164. hOldPalette% = SelectPalette(hCompatDC%, hPalette, FALSE)S
  165. ReturnVal% = RealizePalette(hCompatDC%),
  166. Blast the image into our hidden picture boxa
  167. Free up resources we no longer need
  168. (pbPreview_Click) Warning: Could not delete hComptDC%!
  169. (pbPreview_Click) Warning: Could not delete hBitmap%!"
  170. release previously allocated memoryn
  171. Blast the new picture into the preview picture box
  172. Restore the cursor
  173. PicPreviewHScroll_Change
  174. Set up bitblt parameters
  175. In case anyone has changed the palette since we last painted,
  176. realize it (again)
  177. Blast the new picture into the preview picture box
  178. PicPreviewVScroll_Change
  179. Set up bitblt parameters
  180. In case anyone has changed the palette since we last painted,
  181. realize it (again)
  182. Blast the new picture into the preview picture box
  183. Form_Unload
  184.  if hPalette is not 0 then we've created a palette that 
  185.  should be deleted before we terminate the program
  186. (Form_Unload) Warning: Could not delete hPalette!"
  187.  Allow Windows to unload our dll
  188. GetProfileInfo
  189. Set_ModalDlg_SysMenu
  190.  Modal dialog boxes usually do not have a System menu or if
  191.  they do, they consist of only MOVE and CLOSE options.  This
  192.  routine is called when a Modal dialog box is about to beh
  193.  displayed, to remove all but the MOVE and CLOSE options
  194.  from the forms system menu.  IconWorks has only two Modal
  195.  dialog boxes: About and SaveFileDlg
  196.  Obtain the handle to the forms System menu 
  197.  Remove all but the MOVE and CLOSE options.  The menu items
  198.  must be removed starting with the last menu item to prevent
  199.  the menu items from taking on new position values as othert
  200.  menu items are being removed.
  201. Switch to.
  202. Separator.
  203. Separator.
  204. Maximize
  205. Minimize
  206. Restoree
  207. pbOK_Click
  208.